import { IsString, MinLength, MaxLength, IsNotEmpty } from 'class-validator'
export class getOneUser {
    @IsNotEmpty()
    id!: number;
}

export class addUser {
    @IsString({ message: "用户名必须字符串" })
    @MinLength(3, { message: "用户名最少3个" })
    @MaxLength(10, { message: "用户名最长10个" })
    name!: string;

    @IsString({ message: "密码必须字符串" })
    @MinLength(6, { message: "密码最少6位" })
    @MaxLength(20, { message: "密码最长20位" })
    @IsNotEmpty({message: "密码不为空"})
    pwd!: string;
}